﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"  Theme="SkinFile"
    CodeFile="Employee.aspx.cs" Inherits="Employee" Title="员工管理" Culture="auto" UICulture="auto" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <h1 id="pagetitle" class="pagetitle">
        员工信息管理
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <div class="anistyle" id="ani">
                    正在加载数据，请耐心等待...
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </h1>
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <div class="condition">
                <div class="conditioninput">
                    <span>请选择部门：</span>
                    <asp:DropDownList ID="DDLdept" runat="server" Width="150px">
                    </asp:DropDownList>
                    员工编号：<asp:TextBox ID="TxtEmpID" runat="server" Width="150px"></asp:TextBox>
                </div>
                <div class="conditionbutton">
                    <asp:Button ID="BtnQuery" runat="server" Text="查询信息" Width="80px" OnClick="BtnQuery_Click" />&nbsp;
                    <asp:Button ID="CreateGo" runat="server" Text="创建新员工" Width="90px" OnClick="CreateGo_Click" />&nbsp;
                    <input id="Button1" type="submit" value="导出结果" onclick="javascript:<%=BtnExport.ClientID%>.click();return false;" />&nbsp;
                </div>
            </div>
            <div runat="server" id="divResult" class="divResult">
                <asp:Label ID="OperationResult" CssClass="result" runat="server" Text=""></asp:Label>
            </div>
            <div class="InfoArea">
                <asp:Panel ID="SummaryPanel" runat="server" Width="100%">
                    <asp:GridView ID="EmpGridView" runat="server" AutoGenerateColumns="False" Width="100%"
                        DataKeyNames="Emp_ID"  SkinID="gridviewSkin">
                        <%--<RowStyle BackColor="#EFF3FB" Height="24px" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" Height="24px" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />--%>
                        <Columns>
                            <asp:BoundField DataField="Emp_ID" HeaderText="员工编号">
                                <HeaderStyle Width="60px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="FullName" HeaderText="员工姓名">
                                <HeaderStyle Width="120px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Sex_Name" HeaderText="性别">
                                <HeaderStyle Width="60px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Dept_Name" HeaderText="部门" />
                            <asp:BoundField DataField="Phone" HeaderText="联系电话">
                                <HeaderStyle Width="120px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="BirthDay" DataFormatString="{0:yyyy-MM-dd }" HtmlEncode="False"
                                HeaderText="出生日期">
                                <HeaderStyle Width="120px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <asp:LinkButton ID="GvEdit" runat="server" OnClick="GvEdit_Click">编辑</asp:LinkButton>
                                    <asp:LinkButton ID="GvDelete" runat="server" OnClick="GvDelete_Click" OnClientClick="javascript:return confirm('您确定要删除此条记录吗？');">删除</asp:LinkButton>
                                    <asp:LinkButton ID="GvDetail" runat="server" OnClick="GvDetail_Click">详细</asp:LinkButton>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <webdiyer:AspNetPager ID="AspNetPager" runat="server" ShowCustomInfoSection="Left"
                        CustomInfoHTML="总记录数：%RecordCount%，总页数：%PageCount%，当前为第%CurrentPageIndex%页" CustomInfoTextAlign="left"
                        CustomInfoStyle="padding-top:8px;font-weight:bold;" HorizontalAlign="right" FirstPageText="首页"
                        LastPageText="尾页" NextPageText="下一页" OnPageChanged="AspNetPager_PageChanged"
                        PrevPageText="上一页" ShowPageIndexBox="Always" SubmitButtonText="Go" TextAfterPageIndexBox="页"
                        TextBeforePageIndexBox="转到" CssClass="anpager" CurrentPageButtonClass="cpb">
                    </webdiyer:AspNetPager>
                </asp:Panel>
                <asp:Panel ID="EditPanel" runat="server" Width="100%">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehaveborder">
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;员工编号：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="EditEmp_ID" runat="server" Width="151px" class="id"></asp:Label></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;所属部门：</td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="EditDept_ID" runat="server" Width="155px" ValidationGroup="Edit">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;员工姓名 ：</td>
                            <td>
                                <asp:TextBox ID="EditFullName" runat="server" MaxLength="50" ValidationGroup="Edit"></asp:TextBox></td>
                            <td>
                                <asp:RequiredFieldValidator ID="EditFullNameRequired" runat="server" ControlToValidate="EditFullName"
                                    Display="Dynamic" ErrorMessage="请输入员工姓名！" ValidationGroup="Edit"></asp:RequiredFieldValidator>&nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;性 &nbsp;&nbsp; 别 ：</td>
                            <td>
                                <asp:DropDownList ID="EditSex_Code" runat="server" Width="155px" ValidationGroup="Edit">
                                    <asp:ListItem Value="0">男</asp:ListItem>
                                    <asp:ListItem Value="1">女</asp:ListItem>
                                </asp:DropDownList></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;身份证号：</td>
                            <td>
                                <asp:TextBox ID="EditIDCard" runat="server" MaxLength="30" ValidationGroup="Edit"></asp:TextBox></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;出生日期：</td>
                            <td>
                                <asp:TextBox ID="EditBirthDay" runat="server" MaxLength="10" ValidationGroup="Edit"></asp:TextBox></td>
                            <td>
                                <ajaxToolkit:CalendarExtender ID="EditBirthDayExtender" runat="server" Format="yyyy-MM-dd"
                                    TargetControlID="EditBirthDay">
                                </ajaxToolkit:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;联系电话：</td>
                            <td>
                                <asp:TextBox ID="EditPhone" runat="server" MaxLength="50" ValidationGroup="Edit"></asp:TextBox></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;家庭住址：</td>
                            <td colspan="2">
                                <asp:TextBox ID="EditHome_Addr" runat="server" MaxLength="200" ValidationGroup="Edit"
                                    Width="99%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 70px; padding-top: 6px;" valign="top">
                                &nbsp;&nbsp;备注信息：</td>
                            <td colspan="2" valign="top" style="padding-top: 6px;">
                                <asp:TextBox ID="EditRem" runat="server" Height="60px" TextMode="MultiLine" Width="99%"
                                    MaxLength="200" ValidationGroup="Edit"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td class="tblfooter" colspan="3" align="right">
                                <asp:Button ID="EditSave" runat="server" Text="保 存" Width="90px" OnClick="EditSave_Click"
                                    ValidationGroup="Edit" />
                                <asp:Button ID="EditBack" runat="server" Text="返 回" Width="90px" OnClick="EditBack_Click" /></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="CreatePanel" runat="server" Width="100%">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehaveborder">
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;员工编号：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="CreateEmp_ID" runat="server" Width="151px" class="id"></asp:Label></td>
                            <td style="width: 150px;">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;所属部门：</td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="CreateDept_ID" runat="server" Width="155px" ValidationGroup="Create">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;员工姓名 ：</td>
                            <td>
                                <asp:TextBox ID="CreateFullName" runat="server" MaxLength="50" ValidationGroup="Create"></asp:TextBox></td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="CreateFullName"
                                    Display="Dynamic" ErrorMessage="请输入员工姓名！" ValidationGroup="Create"></asp:RequiredFieldValidator>&nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;性 &nbsp;&nbsp; 别 ：</td>
                            <td>
                                <asp:DropDownList ID="CreateSex_Code" runat="server" Width="155px" ValidationGroup="Create">
                                    <asp:ListItem Value="0">男</asp:ListItem>
                                    <asp:ListItem Value="1">女</asp:ListItem>
                                </asp:DropDownList></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;身份证号：</td>
                            <td>
                                <asp:TextBox ID="CreateIDCard" runat="server" MaxLength="30" ValidationGroup="Create"></asp:TextBox></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;出生日期：</td>
                            <td>
                                <asp:TextBox ID="CreateBirthDay" runat="server" MaxLength="10" ValidationGroup="Create"></asp:TextBox></td>
                            <td>
                                <ajaxToolkit:CalendarExtender ID="CreateBirthDayExtender" runat="server" Format="yyyy-MM-dd"
                                    TargetControlID="CreateBirthDay">
                                </ajaxToolkit:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;联系电话：</td>
                            <td>
                                <asp:TextBox ID="CreatePhone" runat="server" MaxLength="30" ValidationGroup="Create"></asp:TextBox></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;家庭住址：</td>
                            <td colspan="2">
                                <asp:TextBox ID="CreateHome_Addr" runat="server" MaxLength="200" ValidationGroup="Create"
                                    Width="99%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 70px; padding-top: 6px;" valign="top">
                                &nbsp;&nbsp;备注信息：</td>
                            <td colspan="2" valign="top" style="padding-top: 6px;">
                                <asp:TextBox ID="CreateRem" runat="server" Height="60px" TextMode="MultiLine" Width="99%"
                                    Style="word-break: all;" MaxLength="200" ValidationGroup="Create"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td class="tblfooter" colspan="3" align="right">
                                &nbsp;<asp:Button ID="CreateSave" runat="server" Text="保 存" Width="90px" OnClick="CreateSave_Click"
                                    ValidationGroup="Create" />
                                <asp:Button ID="CreateBack" runat="server" Text="返 回" Width="90px" OnClick="CreateBack_Click" /></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="DetailPanel" runat="server" Width="100%">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehaveborder">
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;员工编号：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailEmp_ID" runat="server" Width="100%" class="id"></asp:Label></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;所属部门：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailDept_ID" runat="server" Width="100%"></asp:Label></td>
                            <td style="width: 150px;">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;员工姓名 ：</td>
                            <td>
                                <asp:Label ID="DetailFullName" runat="server" Width="100%"></asp:Label></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;性 &nbsp;&nbsp; 别 ：</td>
                            <td>
                                <asp:Label ID="DetailSex_Code" runat="server" Width="100%"></asp:Label></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;身份证号：</td>
                            <td>
                                <asp:Label ID="DetailIDCard" runat="server" Width="100%"></asp:Label></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;出生日期：</td>
                            <td>
                                <asp:Label ID="DetailBirthDay" runat="server" Width="100%"></asp:Label></td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;联系电话：</td>
                            <td>
                                <asp:Label ID="DetailPhone" runat="server" Width="100%"></asp:Label></td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px;">
                                &nbsp;&nbsp;家庭住址：</td>
                            <td colspan="2">
                                <asp:Label ID="DetailHome_Addr" runat="server" Width="100%"></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 70px; padding-top: 6px;" valign="top">
                                &nbsp;&nbsp;备注信息：</td>
                            <td colspan="2" valign="top" style="padding-top: 6px;">
                                <asp:Label ID="DetailRem" runat="server" Width="100%"></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td class="tblfooter" colspan="3">
                                <asp:Button ID="EditGo" runat="server" Text="修 改" Width="90px" OnClick="EditGo_Click" />
                                <asp:Button ID="DeleteGo" runat="server" OnClientClick="javascript:return confirm('您确定要删除此条记录吗？');"
                                    Text="删 除" Width="90px" OnClick="DeleteGo_Click" />
                                <asp:Button ID="DetailBack" runat="server" Text="返 回" Width="90px" OnClick="DetailBack_Click" /></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:GridView ID="GridViewExport" runat="server" AutoGenerateColumns="False" Width="90%"
                    Visible="false" DataKeyNames="Emp_ID"  SkinID="gridviewSkin">
                    <%--<RowStyle BackColor="#EFF3FB" Height="24px" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" Height="24px" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />--%>
                    <Columns>
                        <asp:BoundField DataField="Emp_ID" HeaderText="员工编号">
                            <HeaderStyle Width="60px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="FullName" HeaderText="员工姓名">
                            <HeaderStyle Width="120px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Sex_Name" HeaderText="性别">
                            <HeaderStyle Width="60px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Dept_Name" HeaderText="部门" />
                        <asp:BoundField DataField="IDCard" HeaderText="身份证号" />
                        <asp:BoundField DataField="Home_addr" HeaderText="家庭住址" />
                        <asp:BoundField DataField="Phone" HeaderText="联系电话">
                            <HeaderStyle Width="120px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="BirthDay" DataFormatString="{0:yyyy-MM-dd }" HtmlEncode="False"
                            HeaderText="出生日期">
                            <HeaderStyle Width="120px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="rem" HeaderText="备注" />
                    </Columns>
                </asp:GridView>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:Button ID="BtnExport" runat="server" Text="导出结果" Width="90px" Style="display: none;"
        OnClick="BtnExport_Click" />
</asp:Content>
